package com.xlhj.yucloud.util;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;

/**
 * @author: liucaijing
 * @description: 日期时间工具类
 * @date: 2021/9/18 15:59
 */
public class DateUtils {

    /**
     * 将指定日期转化为LocalDateTime
     * @param dateStr
     * @return
     */
    public static LocalDateTime getLocalDateTimeFromDateStr(String dateStr, LocalTime localTime) {
        LocalDate localDate = LocalDate.parse(dateStr);
        return LocalDateTime.of(localDate, localTime);
    }

    /**
     * 获取当前日期时间
     * @return
     */
    public static LocalDateTime getLocalDateTime() {
        return LocalDateTime.now();
    }
}
